/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved All rights reserved.
 */
package com.kaaction.modules.crab.entity;

import org.hibernate.validator.constraints.Length;

import java.util.Date;

import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.kaaction.common.persistence.DataEntity;
import com.kaaction.common.utils.excel.annotation.ExcelField;

/**
 * 兑换券查看Entity
 * @author huanghaiming
 * @version 2017-07-19
 */
public class CouponDetail extends DataEntity<CouponDetail> {
	
	private static final long serialVersionUID = 1L;
	private String couponId;		// coupon_id
	private String couponName;		// coupon_id
	private String cardNum;		// 卡号
	private String password;		// 密码
	private String activatedState;		// 激活状态
	private String useState;		// 使用状态
	private String remarks;	// 备注
	private String aState;	// 激活状态1
	private String uState;	// 使用状态2
	private Date createDate;	// 创建日期
	
	private String numStart;	// 兑换券开始
	private String numEnd;	//  兑换券结束
	
	private String numStartOne;	// 兑换券开始
	private String numEndTwo;	//  兑换券结束
	
	private String numOne;	// 兑换券开始
	private String numTwo;	//  兑换券结束
	
	public CouponDetail() {
		super();
	}

	public CouponDetail(String id){
		super(id);
	}

	@Length(min=1, max=64, message="coupon_id长度必须介于 1 和 64 之间")
	public String getCouponId() {
		return couponId;
	}

	public void setCouponId(String couponId) {
		this.couponId = couponId;
	}
	
	public String getCouponName() {
		return couponName;
	}

	public void setCouponName(String couponName) {
		this.couponName = couponName;
	}

	@Length(min=1, max=64, message="卡号长度必须介于 1 和 64 之间")
	@ExcelField(title="卡号", align=2, sort=1)
	public String getCardNum() {
		return cardNum;
	}

	public void setCardNum(String cardNum) {
		this.cardNum = cardNum;
	}
	
	@NotNull(message="密码不能为空")
	@ExcelField(title="密码", align=2, sort=4)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	@Length(min=0, max=3, message="激活状态长度必须介于 0 和 3 之间")
	@ExcelField(title="激活状态", align=2, sort=13 ,type=2)
	public String getActivatedState() {
		return activatedState;
	}

	public void setActivatedState(String activatedState) {
		this.activatedState = activatedState;
	}
	
	@ExcelField(title="激活状态", align=2, sort=13 ,type=1)
	public String getaState() {
		String str = "";
		if("0".equals(aState)){
			str="未激活";
		}else if("1".equals(aState)){
			str="已激活";
		}else if("2".equals(aState)){
			str="已作废";
		}
		return str;
	}

	public void setaState(String aState) {
		this.aState = aState;
	}

	@Length(min=0, max=3, message="使用状态长度必须介于 0 和3 之间")
	@ExcelField(title="使用状态", align=2, sort=17,type=2)
	public String getUseState() {
		return useState;
	}

	public void setUseState(String useState) {
		this.useState = useState;
	}

	@ExcelField(title="使用状态", align=2, sort=17,type=1)
	public String getuState() {
		
		String str = "";
		if("0".equals(uState)){
			str="未使用";
		}else if("1".equals(uState)){
			str="已使用";
		}
		return str;
	}

	public void setuState(String uState) {
		this.uState = uState;
	}

	@ExcelField(title="备注", align=2, sort=10)
	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="生成时间", align=2, sort=7)
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getNumStart() {
		return numStart;
	}

	public void setNumStart(String numStart) {
		this.numStart = numStart;
	}

	public String getNumEnd() {
		return numEnd;
	}

	public void setNumEnd(String numEnd) {
		this.numEnd = numEnd;
	}

	public String getNumOne() {
		return numOne;
	}

	public void setNumOne(String numOne) {
		this.numOne = numOne;
	}

	public String getNumTwo() {
		return numTwo;
	}

	public void setNumTwo(String numTwo) {
		this.numTwo = numTwo;
	}

	public String getNumStartOne() {
		return numStartOne;
	}

	public void setNumStartOne(String numStartOne) {
		this.numStartOne = numStartOne;
	}

	public String getNumEndTwo() {
		return numEndTwo;
	}

	public void setNumEndTwo(String numEndTwo) {
		this.numEndTwo = numEndTwo;
	}

	
	
}